
<div class="cms-form-message">
    <ul style="margin: 0px;">
        <li>Multiple Files May Be Selected At Once. Max Total File Upload Size <b id="max_size_value"><?php echo ini_get("upload_max_filesize"); ?></b></li>
        <li>Images are uploaded at full size, unless Resize options are chosen and then images would be resized on upload</li>
    </ul>
</div>

<form action="<?php echo $this->url(array('action' => 'add')); ?>" method="POST" target="upload-frame" enctype="multipart/form-data" name="img_upload" id="img_upload">
    <table width="550" border="0" cellspacing="0" cellpadding="5" align="center">
        <tr valign="baseline">
            <td align="right" nowrap="nowrap"><strong>* Image Name:</strong></td>
            <td colspan="2">
                <label>
                    <input name="Image[ImageName]" type="text" id="ImageName" size="40" />
                </label>
            </td>
        </tr>
        <tr valign="baseline">
            <td align="right" nowrap="nowrap"><strong>Image Description: </strong></td>
            <td colspan="2"><input name="Image[ImageDescription]" type="text" id="ImageDescription" size="40" /></td>
        </tr>
        
        <tr valign="baseline">
            <td align="right" valign="middle" nowrap="nowrap"><strong>* Image Category:</strong></td>
            <td width="33%" valign="baseline">
                <select name="Image[UseSection]" id="category">
                    <option>Select Category</option>
                    
                    <?php foreach($categories as $category) { ?>
                    <option value="<?php echo $category->getData('CategoryCode'); ?>"><?php echo $category->getData('CategoryName'); ?></option>
                    <?php } ?>
                </select>
            </td>
            <td width="43%" valign="middle">&nbsp;</td>
        </tr>
        <tr valign="baseline">
            <td align="right" nowrap="nowrap">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td align="right"><b>Upload Options</b></td>
            <td>
                <label for="resize"><input type="checkbox" name="resize" value="resize" id="resize"> Resize Images On Upload</label>
            </td>
        </tr>
        
        <tr>
            <td align="right">&nbsp;</td>
            <td colspan="2" id="resize_options">
                <label for="max-width" style="color: #ccc;">Width: <input type="number" name="max-width" id="max-width" value="800" min="0" size="7" disabled="" /> px</label> &nbsp; 
                <!--<label for="max-height" style="color: #ccc;">Height: <input type="number" name="max-height" id="max-height" value="600" min="0" size="7" disabled="" /> px</label>-->
            </td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        
        <tr valign="baseline">
            <td align="right" nowrap="nowrap" ><strong>Select Images:</strong></td>
            <td colspan="2">
                <input name="uploadfile[]" type="file" id="image_fs" size="40" style="padding: 5px;" multiple="" accept="image/*" />
            </td>
        </tr>
        <tr valign="baseline">
            <td nowrap="nowrap" align="right">&nbsp;</td>
            <td colspan="2" valign="middle" class="small">
                <div id="upload_status"></div>
                <div id="file_list"></div>
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <input name="destFileName" type="hidden" id="destFileName" value="<?php echo "img"; ?>" />
                <input name="destFolder" type="hidden" id="destFolder" value="../assets/images/<?php echo SITE_TAG; ?>/pics/" />
                <input name="allowOverwrite" type="hidden" value="yes" />
                <input name="Picture" type="hidden" id="Picture" />
                <input name="maxlimit" type="hidden" id="maxlimit" value="2097152" />
                <input name="allowed_ext" type="hidden" id="allowed_ext" value="jpg,gif,png" />
                <input name="thumbFolder" type="hidden" id="thumbFolder" checked="checked" value="../assets/images/<?php echo SITE_TAG; ?>/thumbs/" />
            </td>
        </tr>
    </table>
    <input type="hidden" name="MM_insert" value="img_upload" />
</form>   

<iframe width="10" height="10" src="about:home" style="opacity: 0;" name="upload-frame" id="upload-frame" />